In coding theory, the Walsh–Hadamard code, named after the American mathematician Joseph Leonard Walsh and the French mathematician Jacques Hadamard, is an example of a linear code over a binary alphabet that maps messages of length to codewords of length . The Walsh–Hadamard code is unique in that each non-zero codeword has Hamming weight of exactly , which implies that the distance of the code is also . In standard coding theory notation, this means that the Walsh–Hadamard code is a -code. The Hadamard code can be seen as a slightly improved version of the Walsh–Hadamard code as it achieves the same block length and minimum distance with a message length of , that is, it can transmit one more bit of information per codeword, but this improvement comes at the expense of a slightly more complicated construction.
The Walsh–Hadamard code is a locally decodable code, which provides a way to recover parts of the original message with high probability, while only looking at a small fraction of the received word. This gives rise to applications in computational complexity theory and particularly in the design of probabilistically checkable proofs. It can also be shown that, using list decoding, the original message can be recovered as long as less than 1/2 of the bits in the received word have been corrupted.
In code division multiple access (CDMA) communication, the Walsh–Hadamard code is used to define individual communication channels. It is usual in the CDMA literature to refer to codewords as “codes”. Each user will use a different codeword, or “code”, to modulate their signal. Because Walsh–Hadamard codewords are mathematically orthogonal, a Walsh-encoded signal appears as random noise to a CDMA capable mobile terminal, unless that terminal uses the same codeword as the one used to encode the incoming signal.[1]
Contents |
The generator matrix for the Walsh–Hadamard code of dimension is given by
where is the vector corresponding to the binary representation of . In other words, is the list of all vectors of in some lexicographic order. For example, the generator matrix for the Walsh–Hadamard code of dimension 3 is
As is possible for any linear code generated by a generator matrix, we encode a message , viewed as a row vector, by computing its codeword using the vector-matrix product in the vector space over the finite field :
This way, the matrix defines a linear operator and we can write .[2]
A more explicit, equivalent definition of uses the scalar product over :
Then the Walsh–Hadamard code is the function that maps every string into the string satisfying for every (where denotes the th coordinate of , identifying with in some way).
The distance of a code is the minimum Hamming distance between any two distinct codewords, i.e., the minimum number of positions at which two distinct codewords differ. Since the Walsh–Hadamard code is a linear code, the distance is equal to the minimum Hamming weight among all of its non-zero codewords. All non-zero codewords of the Walsh–Hadamard code have a Hamming weight of exactly by the following argument.
Let be the generator matrix for a Walsh-Hadamard code of dimension .
Let represent the Hamming weight of vector .
Let be a non-zero message in .
We want to show that for all non-zero codewords. Remember that all arithmetic is done over , which is the finite field of size 2.
Let be a non-zero bit of arbitrary message, . Pair up the columns of such that for each pair , (where is the zero vector with a 1 in the position). By the way is constructed, there will be exactly pairs. Then note that . , implies that exactly one of , must be 1. There are pairs, so will have exactly bits that are a 1.
Therefore, the Hamming weight of every codeword in the code is exactly .
Being a linear code, this means that the distance of the Walsh-Hadamard code is .
A locally decodable code is a code that allows a single bit of the original message to be recovered with high probability by only looking at a small portion of the received word. A code is -query locally decodable if a message bit, , can be recovered by checking bits of the received word. More formally, a code, , is -locally decodable, if there exists a probabilistic decoder, , such that (Note: represents the Hamming distance between vectors and ):
, implies that
Theorem 1: The Walsh–Hadamard code is -locally decodable for .
Lemma 1: For all codewords, in a Walsh–Hadamard code, , , where represent the bits in in positions and respectively, and represents the bit at position .
Let be the codeword in corresponding to message
Let be the generator matrix of
By definition, . From this, . By the construction of , . Therefore, by substitution, .
To prove theorem 1 we will construct a decoding algorithm and prove its correctness.
Input: Received word
For each :
Output: Message
For any message, , and received word such that differs from on at most fraction of bits, can be decoded with probability at least .
By lemma 1, . Since and are picked uniformly, the probability that is at most . Similarly, the probability that is at most . By the union bound, the probability that either or do not match the corresponding bits in is at most . If both and correspond to , then lemma 1 will apply, and therefore, the proper value of will be computed. Therefore the probability is decoded properly is at least . Therefore, and for to be positive, .
Therefore, the Walsh–Hadamard code is locally decodable for